// Deshabilitamos seleccion de texto
function disableselect(e) {return false}
function reEnable() {return true}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar) {
   document.onmousedown=disableselect
   document.onclick=reEnable
};

window.onDomReady (function () {
	
	// Variables de Drags y Drops
	var $drags = $$('#drags div');
	var $drops = $$('#drops div ');
	
	// Modificamos el desplazamiento de del fondo de los drops (background-position).
	$drops.each (function ($drop, iI) {
		var $bgPos = iI*(-180).toString() + 'px -180px';
		$drop.setStyle ('background-position', $bgPos);

	});


	// Creamos objeto tipo Drag and Drop Basico
	var miDxD = new DxD.Swap ($drags, $drops, {
		container: $('content'),
		dragDelete: true,
		sendToBack: 'back',
		cssClass: 'miDxD'
	});
	
	// Definimos funcion de drop correcto (trueDrop)
	miDxD.fncTrueDrop = function ($drag, $drop) {
		if ($drag.Ind == $drop.Ind) return true;
		else return false;
	};

	miDxD.addEvent ('dragOverDrag', function (drag, drags) {
			drags[0].setHTML(drags[0].Ind+':<span style="color: red">'+drags[0].order+'</span>');
			drags[1].setHTML(drags[1].Ind + ':<span style="color: red">'+drags[1].order+'</span>');
	});
	
});